/*
 * Copyright 2025 Clidey, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import 'tailwindcss';
@import 'reactflow/dist/style.css';
@import '@clidey/ux/styles.css';

@custom-variant dark (&:where(.dark, .dark *));
@custom-variant hover (&:hover);

/* Desktop Linux-only bundled font: Inter variable fonts
   Place these files in frontend/public/fonts before building:
   - Inter-roman.var.woff2
   - Inter-italic.var.woff2
   Vite copies public/ to / in the build, so URLs are /fonts/*.woff2 */
@supports (font-variation-settings: normal) {
    @font-face {
        font-family: "Inter var";
        src: url("/fonts/Inter-roman.var.woff2") format("woff2");
        font-weight: 100 900;
        font-style: normal;
        font-display: swap;
    }
    @font-face {
        font-family: "Inter var";
        src: url("/fonts/Inter-italic.var.woff2") format("woff2");
        font-weight: 100 900;
        font-style: italic;
        font-display: swap;
    }
}

:root {
  --brand-foreground: #ca6f1e;
  
  /* UI Customization defaults - these will be overridden by theme-customization.ts */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
}

.linux :root, :root.linux {
    /* no-op: selector placeholder to allow :root.linux overrides below */
}

/* Base font uses the theme variable, which we can override per-OS */
body {
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Desktop Linux-only font override: prefer Inter variable if bundled */
:root.linux {
    --font-sans: "Inter var", "Inter", ui-sans-serif, system-ui, sans-serif;
}

.dark {
  --brand-foreground: #ca6f1e;
}

.dark .react-flow__controls-button {
  background-color: rgb(255 255 255 / 0.1);
  border-color:  rgb(255 255 255 / 0.1);
  fill: white;
}

.dark .react-flow__controls-button:hover {
  background-color: rgb(255 255 255 / 0.2);
  border-color:  rgb(255 255 255 / 0.2);
}

.markdown-preview > * {
  all: revert;
}

[data-slot="drawer-overlay"] {
  transform: translateY(-10vh);
}

.table-search-highlight {
  transition: background-color 0.3s ease-in-out;
  border-radius: 0.25rem;
}

/* UI Customization utility classes */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }


.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.gap-xl { gap: var(--spacing-xl); }
.gap-2xl { gap: var(--spacing-2xl); }
.gap-3xl { gap: var(--spacing-3xl); }


[data-slot="table-container"] {
  width: 100%;
}

.react-flow__controls {
  border: 0;
  box-shadow: none;
}

.react-flow__controls > button:first-child {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.react-flow__controls > button:last-child {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.react-flow__controls-button {
  padding: 8px;
  background: var(--secondary) !important;
  border-bottom: 0;
}

[role="tree"] [data-radix-collection-item] > svg:first-child {
  transform: rotateZ(270deg);
}

[data-testid="mode-toggle"] {
  z-index: 5;
}
